#
# Makefile for CS181 Decision Trees
# Do not modify unless you add more source files.
#
# Please note that we use the g++ compiler to take 
# advantage of some C++ features such as streams.
# Feel free to use any C++ features you wish.

SUBMIT   = /usr/local/bin/submit
SOURCES  = dtree.c dtree_util.c
HEADERS  = dtree_util.h dtree.h
OBJECTS  = $(SOURCES:.c=.o)
RESULT   = dtree

CC = g++
CFLAGS = -g -O -Wall -ansi -pedantic
RM = rm -f

.SUFFIXES:
.SUFFIXES: .c .o

$(RESULT): $(OBJECTS)
	$(CC) -o $@ $(OBJECTS)

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<

clean:
	$(RM) $(RESULT) *.o *.core core *~

submit: $(RESULT)
	$(RM) $(RESULT) *.o *.core core *~
	$(SUBMIT) cs181 2 `pwd`

dtree_util.o: dtree_util.c dtree_util.h
dtree.o: dtree.c dtree.h dtree_util.h
